<!---------------------------- [ 订单主表内容 ] ------------------------------>
<!-- <order_main order="$order" /> -->
<code name="order_main">
    <div class="block-area">
        <div class="form-group col-xs-6">
            <label class="col-sm-3 control-label"><span class="form-required">*</span>委托单位</label>
            <div class="col-md-8 col-sm-9">
                <p class="form-control-static"><empty name="order">{$company_info.name}<else/>{$order.company_name}</empty></p>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-transport_mode" class="col-sm-3 control-label"><span class="form-required">*</span>运输方式</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.transport_mode|dict_convert="transport_mode",###}</p>
                    <else/>
                    <dcselect list="transport_modes" id="input-transport_mode" class="form-control transport_mode w-12" name="transport_mode" value="$order.transport_mode" />
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-ship_company" class="col-sm-3 control-label"><span class="form-required">*</span>船公司</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.ship_company|dict_convert="ship_company",###}</p>
                    <else/>
                    <dcselect list="ship_companies" id="input-ship_company" class="form-control ship_company w-12" name="ship_company" value="$order.ship_company" />
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-vessel" class="col-sm-3 control-label"><span class="form-required">*</span>船名 / 航次</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.vessel} / {$order.voyage_no}</p>
                    <else/>
                    <input id="input-vessel" class="form-control w-90" value="{$order.vessel}" type="text" name="vessel" placeholder="船名">
                    /
                    <input id="input-voyage_no" class="form-control w-90" value="{$order.voyage_no}" type="text" name="voyage_no" placeholder="航次">
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-bl_no" class="col-sm-3 control-label"><span class="form-required">*</span>提单号</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.bl_no}</p>
                    <else/>
                    <input id="input-bl_no" class="form-control w-12" value="{$order.bl_no}" type="text" name="bl_no" placeholder="提单号">
                </empty>
            </div>
        </div>
        <!---------- [ 进重不显示 ] ------------>
        <eq name="reserve_type" value="1">
            <div class="form-group col-xs-6">
                <label for="input-vessel" class="col-sm-3 control-label"><span class="form-required">*</span>箱型 / 箱量</label>
                <div class="col-md-8 col-sm-9">
                    <empty name="editable">
                        <p class="form-control-static">{$order.container_type} / {$order.container_num}</p>
                        <else/>
                        <dcselect list="container_types" id="input-container_type" class="form-control w-90" name="container_type" value="$order.container_type" />
                        /
                        <input id="input-container_num" class="form-control w-90" value="{$order.container_num}" type="text" name="container_num" placeholder="箱量">
                    </empty>
                </div>
            </div>
        </eq>
        <!---------- [ 进重不显示 ] ------------>
        <eq name="reserve_type" value="1">
        <div class="form-group col-xs-6">
            <label for="input-use_time" class="col-sm-3 control-label"><span class="form-required">*</span>预计提箱时间</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.use_time|time_format="Y-m-d H:i:s",###}</p>
                    <else/>
                    <input id="input-use_time" class="form-control w-12 js-datetime" value="<notempty name="order.use_time">{$order.use_time|date='Y-m-d H:i',###}</notempty>" type="text" name="use_time" placeholder="{:date('Y-m-d H:i')}">
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-use_place" class="col-sm-3 control-label"><span class="form-required">*</span>提箱地点</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.use_place|dict_convert="station",###}</p>
                    <else/>
                    <input class="form-control w-12 popup-url" placeholder="请选择提箱地点" data-url="{:url('station/choose')}" type="text" value="{$order.use_place|dict_convert="station",###}" data-height="600" />
                    <input type="hidden" name="use_place" value="{$order.use_place}" id="input-use_place" />
                </empty>
            </div>
        </div>
        </eq>

        <eq name="reserve_type" value="2">
            <div class="form-group col-xs-6">
                <label for="input-place_of_start" class="col-sm-3 control-label"><span class="form-required">*</span>提货点</label>
                <div class="col-md-8 col-sm-9">
                    <empty name="editable">
                        <p class="form-control-static">{$order.place_of_start|dict_convert="station",###}</p>
                        <else/>
                        <dcselect list="stations" id="input-place_of_start" class="form-control w-12" name="place_of_start" value="$order.place_of_start" />
                    </empty>
                </div>
            </div>
            <div class="form-group col-xs-6">
                <label for="input-place_of_end" class="col-sm-3 control-label"><span class="form-required">*</span>运抵地</label>
                <div class="col-md-8 col-sm-9">
                    <empty name="editable">
                        <p class="form-control-static">{$order.place_of_end|dict_convert="station",###}</p>
                        <else/>
                        <dcselect list="stations" id="input-place_of_end" class="form-control w-12" name="place_of_end" value="$order.place_of_end" />
                    </empty>
                </div>
            </div>
        </eq>

        <div class="form-group col-xs-6">
            <label for="input-contact_name" class="col-sm-3 control-label"><span class="form-required">*</span>联系人</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.contact_name}</p>
                    <else/>
                    <input id="input-contact_name" class="form-control w-12" value="{$order.contact_name}" type="text" name="contact_name" placeholder="联系人">
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-contact_mobile" class="col-sm-3 control-label"><span class="form-required">*</span>联系电话</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.contact_mobile}</p>
                    <else/>
                    <input id="input-contact_mobile" class="form-control w-12" value="{$order.contact_mobile}" type="text" name="contact_mobile" placeholder="联系电话">
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label for="input-remark" class="col-sm-3 control-label"><span class="form-required"></span>备注</label>
            <div class="col-md-8 col-sm-9">
                <empty name="editable">
                    <p class="form-control-static">{$order.remark}</p>
                    <else/>
                    <input id="input-remark" class="form-control w-12" value="<notempty name="order.remark">{$order.remark}</notempty>" type="text" name="remark" placeholder="备注">
                </empty>
            </div>
        </div>
        <div class="form-group col-xs-6">
            <label class="col-sm-3 control-label"><span class="form-required"></span>制单人</label>
            <div class="col-md-8 col-sm-9">
                <p class="form-control-static"><empty name="order">{$user_info.user_nickname}<else/>{$order.user_name}</empty></p>
            </div>
        </div>

    </div>
</code>
<!---------------------------- [ 空箱预约列表 ] ------------------------------>
<!-- <reserve_empty order="$order" /> --->
<code name="reserve_empty">
    <thead>
    <tr>
        <th width="130">运单号</th>
        <th width="50">箱型</th>
        <th width="110">箱号</th>
        <th>提箱地点</th>
        <th width="230">进港时间</th>
        <th width="100" class="text-center">指定箱号</th>
        <th width="60">状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <foreach name="order.reserveContainers" item="vo">
        <tr>
            <td>{$vo.waybill_no|default=""}</td>
            <td>{$vo.container_type}</td>
            <td>{$vo.container_no|default="未获取"}</td>
            <td>{$vo.place_of_take|dict_convert="station",###}</td>
            <td>
                <if condition="($vo.status eq 1)">
                    <a class="btn popup-url" data-url="{:url('order/reserve', ['container_id' => $vo.id, 'reserve_type' => $vo.order_type])}" data-width="320" href="javascript:void(0);">{$vo.gateintime == '-' ? '预约时间' : $vo.gateintime}</a>
                    <else/>
                    {$vo.gateintime}
                </if>
            </td>
            <td class="text-center">
                <notempty name="vo.specify_container_no">
                    <em class="fa fa-check-square-o"></em>
                </notempty>
            </td>
            <td>{$vo.status|dict_convert="waybill_status",###}</td>
            <td>
                <notempty name="vo.receipt_no">
                    <a href="javascript:void(0);" class="popup-url" data-title="设备交接单 - {$vo.container_no}" data-url="{:url('order/containerInterchangeReceipt', ['container_id' => $vo.id])}" data-width="800">设备交接单</a>
                    &nbsp;
                </notempty>
                <egt name="vo.status" value="40">
                    <a href="javascript:parent.window.openapp('{:url('order/haul', ['waybill_no' => $vo.waybill_no])}',Math.random(),'运单运程 - {$vo.waybill_no}',true);">运程</a>
                    &nbsp;

                    <a href="javascript:parent.window.openapp('{:url('order/map', ['waybill_no' => $vo.waybill_no])}',Math.random(),'运单地图 - {$vo.waybill_no}',true);">运单地图</a>
                    &nbsp;
                </egt>
                <a href="javascript:void(0);" class="fa fa-qrcode popup-image" data-url="{$vo.qrcode}" data-title="运单二维码" data-width="300" data-height="380"></a>
            </td>
            </egt>
        </tr>
    </foreach>
    </tbody>
</code>
<!---------------------------- [ 重箱预约列表 ] ------------------------------>
<code name="reserve_loaded_th">
    <tr>
        <egt name="order.status" value="20">
            <th width="130">运单号</th>
        </egt>
        <th width="110">箱号</th>
        <th width="50">箱型</th>
        <th width="80">品名</th>
        <th width="80">件数</th>
        <th width="80">净重</th>
        <th width="80">毛重</th>
        <th width="80">体积</th>
        <egt name="order.status" value="20">
        <th width="230">进港时间</th>
        <th width="60">状态</th>
        </egt>
        <th class="text-center">操作</th>
    </tr>
</code>
<!--- <reserve_loaded_tr order="$order" key="$key" item="vo" /> --->
<code name="reserve_loaded_tr">
    <tr data-key="{$key}">
        <egt name="order.status" value="20">
            <td>{$vo.waybill_no|default=""}</td>
        </egt>
        <td>
            <egt name="order.status" value="20">
                {$vo.container_no}
                <else/>
                <input type="text" class="form-control container_no w-12" name="list[{$key}][container_no]" value="{$vo.container_no}" />
            </egt>
        </td>
        <td>
            <egt name="order.status" value="20">
                {$vo.container_type}
                <else/>
                <dcselect list="container_types" name="list[{$key}][container_type]" class="form-control container_type w-12" value="$vo.container_type" />
            </egt>
        </td>
        <td>
            <egt name="order.status" value="20">
                {$vo.goods_name}
                <else/>
                <input type="text" class="form-control goods_name w-12" name="list[{$key}][goods_name]" value="{$vo.goods_name}" />
            </egt>
        </td>
        <td>
            <egt name="order.status" value="20">
                {$vo.quantity}
                <else/>
                <input type="text" class="form-control input-float quantity w-12" name="list[{$key}][quantity]" value="{$vo.quantity}" />
            </egt>
        </td>
        <td>
            <egt name="order.status" value="20">
                {$vo.net_weight}
                <else/>
                <input type="text" class="form-control input-float net_weight w-12" name="list[{$key}][net_weight]" value="{$vo.net_weight}" />
            </egt>
        </td>
        <td>
            <egt name="order.status" value="20">
                {$vo.gross_weight}
                <else/>
                <input type="text" class="form-control input-float gross_weight w-12" name="list[{$key}][gross_weight]" value="{$vo.gross_weight}" />
            </egt>
        </td>
        <td>
            <egt name="order.status" value="20">
                {$vo.volume}
                <else/>
                <input type="text" class="form-control input-float volume w-12" name="list[{$key}][volume]" value="{$vo.volume}" />
            </egt>
        </td>
        <egt name="order.status" value="20">
        <td>
            <if condition="($vo.status eq 1)">
                <a class="btn popup-url" data-url="{:url('order/reserve', ['container_id' => $vo.id, 'reserve_type' => $vo.order_type])}" data-width="320" href="javascript:void(0);">{$vo.gateintime == '-' ? '预约时间' : $vo.gateintime}</a>
                <else/>
                {$vo.gateintime}
            </if>
        </td>
        <td>{$vo.status|dict_convert="waybill_status",###}</td>
        </egt>
        <td class="text-center">
            <notempty name="vo.receipt_no">
                <a href="javascript:void(0);" class="popup-url" data-title="设备交接单 - {$vo.container_no}" data-url="{:url('order/containerInterchangeReceipt', ['container_id' => $vo.id])}" data-width="800">设备交接单</a>
                &nbsp;
            </notempty>
            <egt name="vo.status" value="40">
                <a href="javascript:parent.window.openapp('{:url('order/haul', ['waybill_no' => $vo.waybill_no])}',Math.random(),'运单运程 - {$vo.waybill_no}',true);">运程</a>
                &nbsp;

                <a href="javascript:parent.window.openapp('{:url('order/map', ['waybill_no' => $vo.waybill_no])}',Math.random(),'运单地图 - {$vo.waybill_no}',true);">运单地图</a>
                &nbsp;
            </egt>
            <egt name="order.status" value="20">
                <a href="javascript:void(0);" class="fa fa-qrcode popup-image" data-url="{$vo.qrcode}" data-title="运单二维码" data-width="300" data-height="380"></a>
                <else/>
                <input type="hidden" class="id" name="list[{$key}][id]" value="{$vo.id}" />
                <a class="tr-del" data-url="{:url('reserve/containerDelete')}" data-id="{$vo.id}" href="javascript:;">删除</a>

            </egt>
        </td>
        </egt>
    </tr>
</code>

